﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IFRS.Web;
using System.Data.SqlClient;
using IFRS.DataAccess.DAL;
using System.Collections;
using System.Configuration;
using IFRS.Models;
using System.Data;
using IFRS_Global;

public partial class GLGroup_GL : PopupBase
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!(Page.IsPostBack || Page.IsCallback))
        {
            ddlGLGroup.SetData(DDL_TYPE.GLGroup, "", false, true);
            btnOK.ValidationGroup = "Master";
            reqGLGroup.SetRequiredField(lblGLGroup, ddlGLGroup, btnOK);
        }
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        int iObjID = ddlGLGroup.SelectedValue.AsInt32();
        string ObjPart = string.Empty;
        switch (iObjID)
        {
            case 1: ObjPart = "../IFRS/WIN31_GL_DEPO_4A.aspx?&GroupID=" + ddlGLGroup.SelectedValue.ToString() + "&GroupName=" + ddlGLGroup.SelectedItem.ToString();
                break;
            case 2: ObjPart = "../IFRS/WIN31_GL_LN_4A.aspx?&GroupID=" + ddlGLGroup.SelectedValue.ToString() + "&GroupName=" + ddlGLGroup.SelectedItem.ToString();
                break;
            case 3: ObjPart = "../IFRS/WIN31_GL_TF_4A.aspx?&GroupID=" + ddlGLGroup.SelectedValue.ToString() + "&GroupName=" + ddlGLGroup.SelectedItem.ToString();
                break;
            case 4: ObjPart = "../IFRS/WIN31_GL_INS_LN_4A.aspx?&GroupID=" + ddlGLGroup.SelectedValue.ToString() + "&GroupName=" + ddlGLGroup.SelectedItem.ToString();
                break;
            case 5: ObjPart = "../IFRS/WIN31_GL_LOT_4A.aspx?&GroupID=" + ddlGLGroup.SelectedValue.ToString() + "&GroupName=" + ddlGLGroup.SelectedItem.ToString();
                break;
            case 6: ObjPart = "../IFRS/WIN31_GL_TR_4A.aspx?&GroupID=" + ddlGLGroup.SelectedValue.ToString() + "&GroupName=" + ddlGLGroup.SelectedItem.ToString();
                break;
            case 7: ObjPart = "../IFRS/WIN31_GL_ISL_4A.aspx?&GroupID=" + ddlGLGroup.SelectedValue.ToString() + "&GroupName=" + ddlGLGroup.SelectedItem.ToString();
                break;
            case 8: ObjPart = "../IFRS/WIN31_GL_INV_4A.aspx?&GroupID=" + ddlGLGroup.SelectedValue.ToString() + "&GroupName=" + ddlGLGroup.SelectedItem.ToString();
                break;
        }

        string sScript = string.Format("<script type='text/javascript'>MainValuesObj('{0}');</script>", ObjPart);
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "MainValuesObj", sScript, false);
    }
    protected void btnCANCEL_Click(object sender, EventArgs e)
    {
        this.CloseWindow();
    }

    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        lblTitleBar1.Text = "Government Saving Bank";
        lblTitleBar2.Text = "Copyright © 2014 All rights Reserved.";
    }
}